<div class="modal-header">
	<button type="button" class="close" data-dismiss="modal" aria-hidden="true"><li class="fa fa-remove"></li></button>
	<h5 class="modal-title">找回密码</h5>
</div>

<div class="modal-body">

	<form id="user-form" name="user-form" class="form-horizontal">

		<div class="box-body">
			<div class="col-md-10">
				<div class="form-group">
					<label for="loginName" class="col-sm-4 control-label">用户名</label>

					<div class="col-sm-8">
						<input type="text" class="form-control" id="userName" name="userName" placeholder="用户名">
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-4 control-label">电子邮箱</label>

					<div class="col-sm-8">
						<input type="text" class="form-control" id="Email" name="emial" placeholder="Email">
					</div>
				</div>
				<div class="form-group">
					<label for="telphone" class="col-sm-4 control-label">手机号</label>

					<div class="col-sm-8">
						<input type="text" class="form-control" id="phone" name="phone" placeholder="手机号">
					</div>
				</div>
				<div class="box-footer text-right form-group">
					<div class="col-sm-7"><button type="button" class="btn btn-default" data-btn-type="cancel" data-dismiss="modal">取消</button></div>
					<div class="col-sm-5"><button type="button" class="btn btn-primary" data-btn-type="save">提交</button></div>
				</div>
			</div>
	</form>

	</div>
	<script>
		$(function() {

			$(".btn-primary").click(function() {
				console.log($("#userName").val());
				console.log($("#Email").val());
				console.log($("#phone").val());
				//			console.log($("#nickName").val());
				$.ajax({
					type: "post",
					url: "/password/select",
					data: {
						username: $("#userName").val(),
						email: $("#Email").val(),
						phone: $("#phone").val()
					},
					success: function(data) {
						data = JSON.parse(data);
						if(data.code == 0) {
							alert("您的密码为：" + data.message + ", 请牢记密码，保护个人信息！");
							location.href = "/user/show";
						} else {
							alert(data.message);
						}
					},
					error: function(er) {
						console.log(er);
					}
				});
			});
		});
	</script>